<template>
  <div class="pagetools">
    <el-row type="flex" justify="space-between">
      <!-- 通过父组件传入的showBefore决定左边容器的显示与隐藏 -->
      <el-col v-if="showBefore" class="before">
        <!-- 左边按钮 通过插槽实现 -->
        <slot name="before" />
      </el-col>
      <el-col>
        <el-row type="flex" justify="end">
          <slot name="after" />
        </el-row>
      </el-col>
    </el-row>
    <hr>
  </div>
</template>

<script>
export default {
  props: {
    showBefore: {
      type: Boolean,
      default: true
    }
  }
}
</script>

<style lang='scss' scoped>
.pagetools{
   hr{
        margin-top: 30px;
   border: none;

            height: 1px;

            background-color:#dcdfe6;
    }
}
</style>
